home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / cnet / sdata_edit.lha / SDATA_Edit < prev    next >
Text File  |  1995-10-07  |  7KB  |  124 lines

  1. /**************************************************************************\
  2.               $VER: SDATA Editor, v1.2 (7-Oct-95) by Dotoran!
  3. \**************************************************************************/
  4. options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  5. tr=transmit ; se=sendstring ; gc=getchar ; qu=query ; gu=getuser
  6.  
  7. se 'n1c6Backing up cb"cabbs.sdatacb" c6file...'
  8. if exists("sysdata:bbs.sdata.bkup") then
  9.   address command "delete sysdata:bbs.sdata.bkup"
  10. address command "copy sysdata:bbs.sdata sysdata:bbs.sdata.bkup"
  11. tr 'cfDone!'
  12. call open(f1,'sysdata:bbs.sdata','r')
  13.     do i=1 to 5 ; var.i=c2d(readch(f1,4)) ; end i
  14. call close(f1) ; changewhere 'SDATA Editor'
  15.  
  16. DISPLAY:
  17.     tr 'f1    z1cf  Edit "bbs.sdata" File  z0'
  18.     tr 'Cc6byc9: cbDotorann1'
  19.     tr "c9Ac6>cb  Total Number of ID'sca: z1c7"left(var.1,5)'z0'
  20.     tr 'c9Bc6>cb    Total Actual Usersca: z1c7'left(var.2,5)'z0'
  21.     tr "c9Cc6>cb   Highest Serial ID #ca: z1c7"left(var.3,5)'z0'
  22.     tr 'c9Dc6>cb Total Number of Callsca: z1c7'left(var.4,10)'z0'
  23.     tr 'c9Ec6>cb    Total Calls in Logca: z1c7'left(var.5,3)'z0'
  24.     tr 'n1caRc6> caReCalculate cf"cdbbs.sdatacf" c6values.'
  25.     tr 'n1ceIc6> ceINFO c6on each variable.'
  26.     tr 'n1cfSc6> cfSAVEc6, then cdQuitc6.'
  27.     tr "n1cdQc6> cdQUITc6, but c9DON'T cfSavec6."
  28.  
  29. START:
  30.     se 'z01Hc6Edit Whichc9: ca'
  31.     gc ; a=index('ABCDERISQ',result) ; if a=0 then signal START
  32.     if a=6 then do ; tr 'cbReScan' ; signal RESCAN ; end
  33.     if a=7 then do ; tr 'ceInfo' ; signal INFO ; end
  34.     if a=9 then do ; tr 'cdQuit' ; exit ; end
  35.     if a=8 then do ; tr 'cfSave' ; signal SAVE ; end
  36.     if a=1 then do ; tr "Total ID's" ; addkeys (var.1)
  37.         prompt 5 normal '"7Hz1cf"' ; v=result ; if v='' then v=var.1
  38.         var.1=v ; signal START ; end
  39.     if a=2 then do ; tr "Total User's" ; addkeys (var.2)
  40.         prompt 5 normal '"7Hz1cf"' ; v=result ; if v='' then v=var.2
  41.         var.2=v ; signal START ; end
  42.     if a=3 then do ; tr "Total SID's" ; addkeys (var.3)
  43.         prompt 5 normal '"7Hz1cf"' ; v=result ; if v='' then v=var.3
  44.         var.3=v ; signal START ; end
  45.     if a=4 then do ; tr "Total Calls" ; addkeys (var.4)
  46.         prompt 5 normal '"7Hz1cf"' ; v=result ; if v='' then v=var.4
  47.         var.4=v ; signal START ; end
  48.     if a=5 then do ; tr "Total Log Calls" ; addkeys (var.5)
  49.         prompt 5 normal '"7Hz1cf"' ; v=result ; if v='' then v=var.5
  50.         var.5=v ; signal START ; end
  51.  
  52. RESCAN:
  53.     tr 'f1caReCalculate cf"cdbbs.sdatacf" c6Valuesn1'
  54.     se 'c6   This function will scan all your user accounts in order '
  55.     se 'that the cacorrect c6values can be used in the cf"cdbbs.sdatacf" c6file. The '
  56.     se 'only value that can c9NOT c6be adequately checked is the total number '
  57.     se 'of calls, as this value will be pulled from memory(meaning it will '
  58.     se 'use the same value that appeared in the file since the last user '
  59.     se 'logged off). caReCalculate c6the values now? c7[cbNoc7]c9: ';gc;a=result
  60.     if a~='Y' then do;tr 'cbNoc6.';signal DISPLAY;end;else tr 'caYesc6!n1'
  61.     gu 2400088 ; acts=result ; users=-1 ; actual=-1 ; hid=0 ; gu 2400100 ; calls=result ; logged=-1
  62.     if open(f1,"sysdata:log/calls","r") then do;do until eof(f1) ; a=readln(f1)
  63.       if index(a,"SIGNON")>0 then logged=logged+1;end ; call close(f1) ; end
  64.     tr 'Cz7c1Presentz0    z1cfCalculatedz0';tr 'Cz7c1Values z0    z1cf  Values  z0'
  65.     tr 'Ccc=======    ==========';tr 'ceTotal Number of User Accounts c9: ca'var.1
  66.     tr 'n1c6Total Number of Actual Users  c1: cb'var.2;tr 'n1ceHighest Serial Number Found   c9: cd'var.3
  67.     tr 'n1c6Total Number of System Calls  c1: cc'left(var.4,11)calls
  68.     tr 'n1ceTotal Entries in "calls" log  c9: cf'left(var.5,11)logged
  69.     do i=1 until han=han2;loadscratch i ; st=result ; savescratch (-i)
  70.       getscratch 1 ; han2=han ; han=result ; getscratch 41 ; sid=result
  71.       users=users+1 ; tr '44Hca'users
  72.       if han~="!" then actual=actual+1 ; tr '44Hcb'actual
  73.       if sid>hid then hid=sid ; tr '44Hcd'hid;end i
  74.     se 'n5c6>6Use these values? c7[caYesc7] c9: ';gc;a=result
  75.     if a='N' then do;tr 'cbNoc6.';signal DISPLAY;end;tr 'caYesc6!'
  76.     var.1=users;var.2=actual;var.3=hid;var.4=calls;var.5=logged
  77.   signal DISPLAY
  78.  
  79. SAVE:
  80.     call open(f1,'sysdata:bbs.sdata','w')
  81.         do i=1 to 5 ; call writech(f1,d2c(var.i,4)) ; end i
  82.     call close(f1)
  83.     do i=1 to 5 ; setobject var.i ; putuser 2400084+(i*4) ; end i
  84.     tr 'n1cb"cabbs.sdatacb" c6file cfSAVEDc6!n1'
  85.   exit
  86.  
  87. INFO:
  88.     tr 'f1c7An explanation of the variables stored in cb"cabbs.sdatacb"c7:n1'
  89.     tr 'c6Total Number of Accounts'
  90.     tr '    c9- ceThis is the total number of accounts that were ever opened up'
  91.     tr '      on your system, regardless of how many may have been deleted'
  92.     tr '      at a later date.n1'
  93.     tr 'c6Total Number of Actual Users'
  94.     tr '    c9- ceThis is the total number of accounts that actually still hold'
  95.     tr '      data for an existing user.n1'
  96.     tr 'c6Total Number of Serial ID Numbers'
  97.     tr '    c9- ceThis is the total number of unique id numbers ever issued on'
  98.     tr '      your system. When an account is killed, a new serial id number'
  99.     tr '      will be issued when that account becomes used again.n1'
  100.     tr 'c6Total Number of Calls to the System'
  101.     tr '    c9- ceThis is the total number of phone calls your system has ever'
  102.     tr '      received. Sometimes, maybe because of a crash, this value may have'
  103.     tr '      been corrupted. This file was written with cbTHIS cevalue in mind.n1'
  104.     qu 'c7Press cdENTER c7now...'
  105.     tr 'n1c6Total Number of Calls in the Log'
  106.     tr '    c9- ceThis is the total number of call entries currently stored in'
  107.     tr '      your "calls" log. When you use the "LC" command, this is the'
  108.     tr '      number of calls you will see in the list.n1'
  109.     tr 'c6   You should be cfVERY c6careful of how you edit these variable values,'
  110.     tr 'because setting one too high or too low could be hazardous to your'
  111.     tr 'system. The cb"caTotal Callscb" c6variable is the only one guaranteed not to'
  112.     tr 'cause havoc in your system because of any value you might give it.n1'
  113.     tr '   When using this program, c9PROCEED WITH CAUTIONc6!  A backup copy of'
  114.     tr 'the cb"casdatacb" c6file is made whenever you enter this program. The backup'
  115.     tr 'file is named cb"cabbs.sdata.bkupcb" c6in your cfSYSDATA: c6directory.n1'
  116.     qu 'c7Press cdENTER c7to continue...'
  117.   signal DISPLAY
  118.  
  119. SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')'
  120.   e2='  Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960;b=result;c='"'a||b'"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2
  121.   e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
  122. /** Last Edited: 7-Oct-95 *************************************************\
  123. \****************************************** Frontiers BBS (716)/823-9892 **/
  124.